package demo;

import java.util.*;

public class meituan2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            int nums = in.nextInt();
            //密码个数
            while (nums > 0) {
                String demo = in.next();
                //Map<Integer,Integer> hash = new HashMap<>();
                int[] hash = new int[126];
                System.out.println(check(demo, hash));
                nums--;
            }
        }
    }
    static String check(String demo, int[] hash) {
        if (demo.length() < 8) {
            return "Weak";
        }
        for (int i = 0; i < demo.length(); i++) {
            char temp = demo.charAt(i);
            hash[temp - '!']++;
        }
        //四种类型
        int type =  haveTarget(hash, 'a', 'z') + haveTarget(hash, 'A',
                'Z') + haveTarget(hash, '0', '9');
        if (haveTarget(hash, '!', '/') == 1 || haveTarget(hash, ':', '@') == 1 ||
                haveTarget(hash, '[', '`') == 1 || haveTarget(hash, '{', '~') == 1) {
            type++;
        }
        if (type == 4) {
            return "Strong";
        } else if (type == 3) {
            return "Medium";
        }
        return "Weak";
    }

    static int haveTarget(int[] hash, char a, char b) {
        int left = a-'!';
        int right = b-'!';
        while(left <= right) {
            if(hash[left] != 0) {
                return 1;
            }
            left++;
        }
        return 0;
    }
}
